The present invention relates generally to a floating-point unit in a computer system, and more particularly to a floating-point unit in a computer system for performing tiny detection in floating-point operations.
The IEEE-754-2008 Standard for Binary Floating-point Arithmetic, published in 2008, specifies a floating-point data architecture that is commonly implemented in computer hardware, such as floating-point processors having multipliers. The format includes a sign, an unsigned biased exponent, and a significand. The sign bit is a single bit and is represented by an “S”. The unsigned biased exponent, represented by an “e”, for example, 8 bits long for single precision, 11 bits long for double precision, and 15 bits long for quadruple precision. The significand is, for example, 24 bits long for single precision, 53 bits long for double precision, or 113 bits long for quadruple precision. As defined by the IEEE-754-2008 standard the most significant bit of the significand, i.e. the so called implicit bit, is decoded out of the exponent bits.
Processors are frequently required to perform mathematical operations using floating-point numbers. Often, a specialized hardware circuit (i.e., a floating-point hardware unit) is included in the microprocessor or electrically coupled to the microprocessor to perform floating-point operations that have three operands, such as the multiply-add operations. Such floating-point operations may be performed faster by using a floating-point unit than they are performed in software, and the software execution unit of the microprocessor would then be free to execute other operations.
However, when floating-point numbers are used in mathematical operations, the result of the operation may be too large or too small to be represented by the floating-point unit. When the result is too large to be represented by the floating-point unit, an “overflow” condition occurs. When the result is too small to be represented by the floating-point unit, an “underflow” condition occurs, and the result is said to be “tiny”. Tiny is the range of numbers between the smallest normalized number and zero. So all subnormal numbers in binary floating point format are tiny. In either case (overflow or underflow), a software routine might be executed to perform the operation if accurate results are required. In such an instance, the system may be burdened by the overhead of both the execution time of the floating-point unit and the execution time of the software routine even though only a single floating-point operation is being performed.